package com.libertas.jump;

import java.util.ArrayList;
import java.util.HashMap;

import com.libertas.begin.*;
import com.libertas.interfaces.IJumpTable;
import com.libertas.interfaces.IMenu;

public class MenuKeepLoginJump implements IJumpTable, IMenu{
	private static MenuKeepLoginJump instance = null;
	private static String menu[];//={"Do Report", "Friends Search", "Setting", "View Event","Recent Live News","Sign Out","Exit"};
	private static HashMap<String,Class> activities = new HashMap<String, Class>();
	private static ArrayList<String> listarray = new ArrayList<String>();
	protected MenuKeepLoginJump() {
	      // Exists only to defeat instantiation.
		 listarray.add(HomeLandSecurity.getStringResourse(R.string.do_report));
		 listarray.add(HomeLandSecurity.getStringResourse(R.string.view_event));
		 listarray.add(HomeLandSecurity.getStringResourse(R.string.friend_search));
		 listarray.add(HomeLandSecurity.getStringResourse(R.string.live_news));
		 listarray.add(HomeLandSecurity.getStringResourse(R.string.setting_name));
		 listarray.add(HomeLandSecurity.getStringResourse(R.string.sign_out));
		 listarray.add(HomeLandSecurity.getStringResourse(R.string.exit_name));
		 menu = listarray.toArray(new String[listarray.size()]);
        addActivityClasses();
	}
	public Class getActivityClass(String actionName) {
		return activities.get(actionName);
	}
	public static MenuKeepLoginJump getInstance() {
	      if(instance == null) {
	         instance = new MenuKeepLoginJump();
	      }
	      return instance;
	   }
	public void addActivityClasses(){
		   activities.put(HomeLandSecurity.getStringResourse(R.string.do_report), ReportActivity.class);
		   //activities.put(HomeLandSecurity.getStringResourse(R.string.view_event), ViewReportActivity.class);
		   activities.put(HomeLandSecurity.getStringResourse(R.string.view_event), ViewIncidentInMapActivity.class);
	}
	public String[] getMenuDescriptor() {
		return menu;
	}

}
